package heliotrope.utils.mission
{
	import flash.events.Event;
	import flash.events.IEventDispatcher;

	public class DynamicMission extends ListenedMission
	{
		protected var _missionDispatcher:IMissionDispatcher
		public function DynamicMission(closure_:Function, params_:Object, listener_:IEventDispatcher, missionDispatcher_:IMissionDispatcher, missionName_:String = "")
		{
			super(closure_, params_, listener_, null, null, missionName_);
			_missionDispatcher = missionDispatcher_;
			
		}
		
		override public function get completeEvent():String
		{
			if(!_completeEvent)
			{
				_completeEvent = _missionDispatcher.getCurrentMissionCompleteEvent();
			}
			return _completeEvent;
		}
		
		override public function get progressEvent():String
		{
			if(!_progressEvent)
			{	
				_progressEvent = _missionDispatcher.getCurrentMissionProgressEvent();
			}
			return _progressEvent;
		}
	}
}